import {
	Http
} from '../common/http.js'

class Celebrity extends Http {
	
	getAddressList(celebrityId, callback){
		let params = {
			url: `/celebrity/${celebrityId}/address`,
			success (res){
				callback && callback(res)
			}
		}
		this.request(params)
	}
	
	getDefaultAddress(celebrityId, callback){
		let params = {
			url: `/celebrity/${celebrityId}/address/default`,
			success (res){
				callback && callback(res)
			}
		}
		this.request(params)
	}
	
	setDefaultAddress(celebrityId, id, callback) {
		let params = {
			url: `/celebrity/${celebrityId}/address/default/${id}`,
			method: 'POST',
			success (res) {
				callback && callback(res)
			}
		}
		this.request(params)
	}
	
	createAddress(celebrityId, data, callback){
		let params = {
			url: `/celebrity/${celebrityId}/address`,
			method: 'POST',
			data,
			success (res) {
				callback && callback(res)
			}
		}
		this.request(params)
	}
	
	updateAddress(celebrityId, aid, data, callback){
		let params = {
			url: `/celebrity/${celebrityId}/address/${aid}`,
			method: 'PUT',
			data,
			success (res) {
				callback && callback(res)
			}
		}
		this.request(params)
	}
	
	deleteAddress(aid, callback){
		let params = {
			url: `/celebrity/address/${aid}`,
			method: 'DELETE',
			success (res) {
				callback && callback(res)
			}
		}
		this.request(params)
	}
}
export {
	Celebrity
}
